package com.iplant.aps.service;

import com.iplant.aps.service.mesenum.BPMEventModule;
import com.iplant.aps.service.po.APIResult;
import com.iplant.aps.service.po.ServiceResult;
import com.iplant.aps.service.po.bms.BMSEmployee;
import com.iplant.aps.service.po.bpm.BPMPropDesc;
import com.iplant.aps.service.po.bpm.BPMTaskBase;
import com.iplant.aps.service.utils.Configuration;

import java.util.List;
import java.util.Map;

public interface BPMService {
	String ServerUrl = Configuration.readConfigString("bpm.server.url", "config/config");

	String ServerName = Configuration.readConfigString("bpm.server.project.name", "config/config");

	/**
	 * 创建流程实例
	 *
	 * @param wModule      模块
	 * @param wBusinessKey 业务单ID
	 * @param wData        提交数据
	 */
	APIResult BPM_CreateProcess(BMSEmployee wLoginUser, BPMEventModule wModule, int wBusinessKey, Object wData);

	/**
	 * 提交流程实例 返回数据有
	 */
	APIResult BPM_CompleteTask(BMSEmployee wLoginUser, int wTaskID, int wLocalScope, Object wData);

	/**
	 * 根据实例ID获取当前操作步骤
	 */
	APIResult BPM_CurrentTask(BMSEmployee wLoginUser, int wProcessInstanceID);

	/**
	 * 根据任务ID获取任务信息
	 */
	APIResult BPM_GetTask(BMSEmployee wLoginUser, int wTaskID);

	/**
	 * 根据任务ID获取可操作步骤
	 */
	APIResult BPM_GetOperationByTaskID(BMSEmployee wLoginUser, int wTaskID);

	/**
	 * 根据实例ID获取待办任务列表
	 */
	APIResult BPM_GetTaskListByInstance(BMSEmployee wLoginUser, int wInstanceID);

	ServiceResult<Boolean> BPM_MsgUpdate(BMSEmployee wLoginUser, int wTaskID, int wLocalScope,
			BPMTaskBase paramBPMTaskBase, Object wData);

	APIResult BPM_GetInstanceByID(BMSEmployee wLoginUser, int wFlowID);

	APIResult BPM_DeleteInstanceByID(BMSEmployee wLoginUser, int wFlowID, String wReason);

	APIResult BPM_GetHistoryInstanceByID(BMSEmployee wLoginUser, int processInstanceId);

	APIResult BPM_GetActivitiHisTaskByPIId(BMSEmployee wLoginUser, int flowID);

    APIResult BPM_DelegateTask(BMSEmployee wLoginUser, String taskId, String userId, String remark);

    ServiceResult<String> BPM_ExportData(BMSEmployee wLoginUser, List<BPMPropDesc> wMainProp, List<Map> wDataMap, String wTilte);

	APIResult BPM_GetFormByPdIdAndActId(BMSEmployee wLoginUser, String definitionId, String activitiId);
}
